package cn.baimo.mapper;

import cn.baimo.pojo.Division;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DivisionMapper {
    //查询所有部门
    @Select("select * from Division")
    List<Division> selectDivisions();
    //通过医生id查询部门
    @Select("select di.* FROM doctor d,hospital_division hd,division di WHERE d.hdid=hd.id and hd.did =di.id and d.id=#{id}")
    Division selectDivisionByDoctorId(int id);
}
